Ext.ns('journal.ui');

// {{{
journal.ui.SearchField = Ext.extend(Ext.ux.form.SearchField, (function() {
    return {
        // configurables
        // anything what is here can be configured from outside

        searchHook : Ext.emptyFn,

        // {{{
        initComponent : function() {

            // hard coded config - cannot be changed from outside
            var config = {};// var config

            // apply config
            Ext.apply(this, Ext.apply(this.initialConfig, config));

            // call parent
            journal.ui.SearchField.superclass.initComponent.apply(this, arguments);

        }, // e/o function initComponent

        onTrigger1Click : function() {//Click the X
            //            journal.ui.SearchField.superclass.onTrigger1Click.call(this);
            this.el.dom.value = '';
            this.store.baseParams = this.store.baseParams || {};
            this.store.baseParams[this.paramName] = '';
            this.triggers[0].hide();
            this.hasSearch = false;
            this.clearInvalid();
        },
        onTrigger2Click : function() {
            this.searchHook(this.getRawValue());
            journal.ui.SearchField.superclass.onTrigger2Click.call(this);
        }
    // }}}
    };
})()); // e/o extend

// register xtype
Ext.reg('journal.ui.SearchField', journal.ui.SearchField);
// }}}
